/*
    Created by IntelliJ IDEA.
    @Auther: gaozhe
    @Date: 2020/5/17 下午 10:30
    
*/
package dao.Impl;

import dao.UserDao;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import pojo.User;
import utils.JDBCUtils;

import java.util.List;
import java.util.Map;

public class UserDaoImpl implements UserDao {
    //jdbc模板引擎
    private JdbcTemplate jdbcTemplate = new JdbcTemplate(JDBCUtils.getDataSource());
    public List<User> findUserByLimit(int pageNumber) {
        String sql = "select * from user_info limit ? , 5";
        List<User> userList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<User>(User.class), pageNumber);
        return userList;
    }
}
